<!DOCTYPE html>
<html>
	<head>
		<title>分类详情</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 所有的 css & js 资源 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
		<link rel="stylesheet" href="../../static/sa.css">
		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.min.js"></script>
		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
		<script src="../../static/sa.js"></script>
	</head>
	<body>
		<div class="vue-box" style="display: none;" :style="'display: block;'">
			<!-- 参数栏 -->
			<div class="c-panel">
				<div class="c-title">详情信息</div>
				<el-form>
					<div class="c-item">
						<label class="c-label">分类ID：</label>
						<span>{{m.id}}</span>
					</div>
					<div class="c-item">
						<label class="c-label">分类名称：</label>
						<span>{{m.name}}</span>
					</div>
				</el-form>
			</div>
		</div>
		<script>
			var app = new Vue({
				el: '.vue-box',
				data: {
					id: sa.p('id', 0),		// 当前id 
					m: {	// 当前对象 
						id: '',		// 分类id 
						name: ''	// 分类名称 
					}
				},
				methods: {
					// 获取数据
					getById: function() {
						sa.ajax('/category/getCategory?id=' + this.id, function(res) {
							this.m = res;
						}.bind(this))
					}
				},
				mounted: function() {
					this.getById();
				}
			})
		</script>
	</body>
</html>
